# num表示生成数据的个数
def fibonacci(num):
    # 初始化前两个值
    a = 0
    b = 1
    # 记录每次生成个数的索引
    cur_index = 0
    while cur_index < num:
        result = a
        a,b =b,a+b
        cur_index += 1
        yield result


# 创建生成器
f = fibonacci(10000)
for value in f:
    print(value)